﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace pc_system.View
{
    public partial class SystemInfo : Form
    {
        public SystemInfo()
        {
            InitializeComponent();
        }
        public SystemInfo(string title, string msg, int btn)
        {
            InitializeComponent();
            this.DialogResult = DialogResult.No;
            if (btn == 1) btnOKC.Show();
            if (btn == 2)
            {
                btnOK.Show();
                btnCancle.Show();
            }
            lbTitle.Text = title;
            lbMessage.Text = msg;
        }
        public SystemInfo(string msg)
        {
            InitializeComponent();
            btnOKC.Show();
            lbTitle.Text = "";
            lbMessage.Text = msg;
        }

        #region 快捷键
        //重写处理命令键方法以监听快捷键
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {

            if (keyData == Keys.Escape)
            {
                //System.Windows.Forms.SendKeys.Send("{F5}");
                this.Close();
                return true;
            }

            //继续原来base.ProcessCmdKey中的处理
            return base.ProcessCmdKey(ref msg, keyData);
        }


        #endregion
    }
}
